
//
// 120822 - AH - (Midtun) Created.
//

package org.soekrat.environment;

import org.soekrat.conversationevent.ConversationEventSource;
import org.soekrat.engine.captor.Captor;
import org.soekrat.engine.liberator.Liberator;
import org.soekrat.engine.liberator.event.LiberatorListener;

/**
 * <p>
 *   Interface for objects that sense data to be passed to 
 *   {@link Captor} and receives liberated (retrieved data) from
 *   {@link Liberator}s.
 * </p>
 * @author Arne Halvorsen (AH)
 * @author Laetitia Le Chatton (LLC)
 */
public interface Sensor extends ConversationEventSource, LiberatorListener
{
  /**
   * <p>
   *   Gets name of data this senses.
   * </p>
   * @return Name.
   */
  String getSensedDataType();

  /**
   * <p>
   *   Convenient method to get this as a given 
   *   {@link Sensor}. 
   * </p>
   * @param clazz {@code Class} of sensor.
   * @return {@code this} as type specified by {@code clazz} or {@code null}
   *         if is not.
   */
  <T extends Sensor> T is(Class<T> clazz);
  
}
